

 function uibdraggable ($document):ng.IDirective {
          return function(scope, element, attr) {
              var startX = 0, startY = 0, x = 0, y = 0;
              element= angular.element(document.getElementsByClassName("modal-dialog")); 
              element.css({
                  position: 'relative',
                  cursor: 'move'
              });
 
              element.on('mousedown', function(event) {
                  // Prevent default dragging of selected content
                  //event.preventDefault();
                  startX = event.pageX - x;
                  startY = event.pageY - y;
                  $('#dialog').on('mousemove', mousemove);
                  $('#dialog').on('mouseup', mouseup);
              });
 
              function mousemove(event) {
                  y = event.pageY - startY;
                  x = event.pageX - startX;
                  element.css({
                      top: y + 'px',
                      left: x + 'px'
                  });
              }
 
              function mouseup() {
                   $('#dialog').off('mousemove', mousemove);
                  $('#dialog').off('mouseup', mouseup);
              }
          };
      }


uibdraggable['$inject'] = ["locationService","$ngBootbox"]
angular.module('uibdraggable', []).directive('uibdraggable',uibdraggable);